using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class GT_PKT_PsdetMap : EntityTypeConfiguration<GT_PKT_Psdet>
    {
        public GT_PKT_PsdetMap()
        {
            // Primary Key
            this.HasKey(t => new { t.PSID, t.ITEM, t.ITEMENTRY, t.PSDET_ID, t.SPID });

            // Properties
            this.Property(t => t.NUMBER)
                .HasMaxLength(8);

            this.Property(t => t.ITEM)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.ITEMENTRY)
                .IsRequired()
                .HasMaxLength(13);

            this.Property(t => t.PSDET_ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            this.Property(t => t.SPID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("GT_PKT_Psdet");
            this.Property(t => t.STORENUM).HasColumnName("STORENUM");
            this.Property(t => t.REGNUM).HasColumnName("REGNUM");
            this.Property(t => t.PSID).HasColumnName("PSID");
            this.Property(t => t.NUMBER).HasColumnName("NUMBER");
            this.Property(t => t.ITEM).HasColumnName("ITEM");
            this.Property(t => t.QTYSHIP).HasColumnName("QTYSHIP");
            this.Property(t => t.PRICE).HasColumnName("PRICE");
            this.Property(t => t.EXTEND).HasColumnName("EXTEND");
            this.Property(t => t.COST).HasColumnName("COST");
            this.Property(t => t.TAXABLE).HasColumnName("TAXABLE");
            this.Property(t => t.DEBIT).HasColumnName("DEBIT");
            this.Property(t => t.LINENUM).HasColumnName("LINENUM");
            this.Property(t => t.GROSSWGHT).HasColumnName("GROSSWGHT");
            this.Property(t => t.PUREWGHT).HasColumnName("PUREWGHT");
            this.Property(t => t.PUREVALUE).HasColumnName("PUREVALUE");
            this.Property(t => t.MKGSPERGRM).HasColumnName("MKGSPERGRM");
            this.Property(t => t.MKGSTOTAL).HasColumnName("MKGSTOTAL");
            this.Property(t => t.CUSTCURR).HasColumnName("CUSTCURR");
            this.Property(t => t.ITEMENTRY).HasColumnName("ITEMENTRY");
            this.Property(t => t.PURITY).HasColumnName("PURITY");
            this.Property(t => t.RATE).HasColumnName("RATE");
            this.Property(t => t.DISCPERC).HasColumnName("DISCPERC");
            this.Property(t => t.DISCVAL).HasColumnName("DISCVAL");
            this.Property(t => t.EXTENDADISC).HasColumnName("EXTENDADISC");
            this.Property(t => t.QOTOINV).HasColumnName("QOTOINV");
            this.Property(t => t.PSDET_ID).HasColumnName("PSDET_ID");
            this.Property(t => t.CORRECTEDCOST).HasColumnName("CORRECTEDCOST");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
            this.Property(t => t.EXPIRYDATE).HasColumnName("EXPIRYDATE");
            this.Property(t => t.LINETAX).HasColumnName("LINETAX");
            this.Property(t => t.SPID).HasColumnName("SPID");
            this.Property(t => t.C_deleted).HasColumnName("_deleted");
        }
    }
}
